
/*/*
 *  Copyright (C) 2011 felixtheripper <felixtheripper_AT_gmail.com>
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

/**
 *
 * @author felixtheripper
 *
 * email: felixtheripper_AT_gmail.com
 * ... please remove "_AT_" from the above string to get the right email address
 *
 */


package org.myorg.ctm.etk.gui.swg.action.actionmanager;


import org.myorg.ctm.etk.gui.swg.action.actioncontroller.ActionController;
import org.myorg.ctm.etk.gui.swg.action.actions.*;


/**
 *
 * 
 */
public class ActionManagerPerspAdministrator extends ActionManagerPerspAbs
{

    public ActionManagerPerspAdministrator(ActionController acr) throws Exception
    {
        super(acr);
    }

    @Override
    protected void loadActions() throws Exception
    {
        super.loadActions();

        super._addAction_(ActGuiNewUser.s_getInstance().getId(),
                ActGuiNewUser.s_getInstance());

        super._addAction_(ActGuiInstallDb.s_getInstance().getId(),
                ActGuiInstallDb.s_getInstance());

        super._addAction_(ActGuiDropDb.s_getInstance().getId(),
                ActGuiDropDb.s_getInstance());

        super._addAction_(ActGuiDeleteUser.s_getInstance().getId(),
                ActGuiDeleteUser.s_getInstance());

        super._addAction_(ActGuiNewPrtApply.s_getInstance().getId(),
                ActGuiNewPrtApply.s_getInstance());

        super._addAction_(ActGuiNewPrtCancel.s_getInstance().getId(),
                ActGuiNewPrtCancel.s_getInstance());

        super._addAction_(ActGuiNewPrtOk.s_getInstance().getId(),
                ActGuiNewPrtOk.s_getInstance());

        super._addAction_(ActGuiNewScrApply.s_getInstance().getId(),
                ActGuiNewScrApply.s_getInstance());

        super._addAction_(ActGuiNewScrOk.s_getInstance().getId(),
                ActGuiNewScrOk.s_getInstance());

        super._addAction_(ActGuiNewScrCancel.s_getInstance().getId(),
                ActGuiNewScrCancel.s_getInstance());
    }

    @Override
    protected void registerCallback()
    {
        super.registerCallback();

        this._registerCallback_(this._acr, ActGuiNewUser.s_getInstance(),
                ActGuiNewUser.s_getInstance().getIdShort());

        this._registerCallback_(this._acr, ActGuiDeleteUser.s_getInstance(),
                ActGuiDeleteUser.s_getInstance().getIdShort());

        this._registerCallback_(this._acr, ActGuiInstallDb.s_getInstance(),
                ActGuiInstallDb.s_getInstance().getIdShort());

        this._registerCallback_(this._acr, ActGuiDropDb.s_getInstance(),
                ActGuiDropDb.s_getInstance().getIdShort());

        this._registerCallback_(this._acr, ActGuiNewPrtApply.s_getInstance(),
                ActGuiNewPrtApply.s_getInstance().getId());

        this._registerCallback_(this._acr, ActGuiNewPrtCancel.s_getInstance(),
                ActGuiNewPrtCancel.s_getInstance().getId());

        this._registerCallback_(this._acr,
                ActGuiNewPrtOk.s_getInstance(), ActGuiNewPrtOk.s_getInstance().getId());

        this._registerCallback_(this._acr,
                ActGuiNewScrApply.s_getInstance(), ActGuiNewScrApply.s_getInstance().getId());

        this._registerCallback_(this._acr,
                ActGuiNewScrOk.s_getInstance(), ActGuiNewScrOk.s_getInstance().getId());

        this._registerCallback_(this._acr,
                ActGuiNewScrCancel.s_getInstance(), ActGuiNewScrCancel.s_getInstance().getId());

    }

    @Override
    protected void unloadActions()
    {
        super.unloadActions();

        if (super._mapIdToAction_ != null)
        {
            super._mapIdToAction_.remove(ActGuiNewUser.s_getInstance().getId());
            super._mapIdToAction_.remove(ActGuiDeleteUser.s_getInstance().getId());
            super._mapIdToAction_.remove(ActGuiInstallDb.s_getInstance().getId());
            super._mapIdToAction_.remove(ActGuiDropDb.s_getInstance().getId());
            super._mapIdToAction_.remove(ActGuiNewPrtApply.s_getInstance().getId());
            super._mapIdToAction_.remove(ActGuiNewPrtCancel.s_getInstance().getId());
            super._mapIdToAction_.remove(ActGuiNewPrtOk.s_getInstance().getId());
            super._mapIdToAction_.remove(ActGuiNewScrApply.s_getInstance().getId());
            super._mapIdToAction_.remove(ActGuiNewScrOk.s_getInstance().getId());
            super._mapIdToAction_.remove(ActGuiNewScrCancel.s_getInstance().getId());
        }
    }

}
